package eraikikon;

//import java.awt.BorderLayout;
//import javax.swing.JPanel;
//import javax.swing.JFrame;
//import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Rectangle;
import java.util.Vector;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;


public class GUI extends JFrame {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;

	private JPanel jPanel = null;

	private JPanel jPanel1 = null;

	private JButton jButton1 = null;

	private JButton jButton2 = null;

	private JButton jButton = null;

	private JButton jButton3 = null;

	private JButton jButton4 = null;

	private JButton jButton5 = null;

	private JButton jButton6 = null;

	private JLabel jLabel = null;

	private JLabel jLabel1 = null;

	private JTextField jTextField = null;

	private JPasswordField jPasswordField = null;

	private GUI gui;

	private Kudeatzailea kudeatzailea = new Kudeatzailea(); // @jve:decl-index=0:

	private Vector<TxartelIrakurgailua> nora;

	private Integer unekoGunea;

	private JPanel jPanel2 = null;

	private JButton jButton7 = null;

	private JButton jButton8 = null;

	private JButton jButton9 = null;

	private JButton jButton10 = null;

	private JButton jButton11 = null;

	private JButton jButton12 = null;

	private JButton jButton13 = null;

	/**
	 * This is the default constructor
	 */
	public GUI() {
		super();
		initialize();
		gui = this;
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(798, 554);
		this.setContentPane(getJContentPane());
		this.setTitle("JFrame");
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			jContentPane.add(getJPanel(), BorderLayout.NORTH);
			jContentPane.add(getJPanel1(), BorderLayout.CENTER);
			jContentPane.add(getJPanel2(), BorderLayout.SOUTH);
		}
		return jContentPane;
	}

	/**
	 * This method initializes jPanel
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPanel() {
		if (jPanel == null) {
			jLabel1 = new JLabel();
			jLabel1.setBounds(new Rectangle(30, 75, 196, 31));
			jLabel1.setText("Pasahitza sartu:");
			jLabel = new JLabel();
			jLabel.setBounds(new Rectangle(30, 30, 196, 31));
			jLabel.setText("Txartel identifikadorea sartu:");
			jPanel = new JPanel();
			jPanel.setLayout(null);
			jPanel.setPreferredSize(new Dimension(50, 125));
			jPanel.add(getJButton(), null);
			jPanel.add(jLabel, null);
			jPanel.add(jLabel1, null);
			jPanel.add(getJTextField(), null);
			jPanel.add(getJPasswordField(), null);
		}
		return jPanel;
	}

	/**
	 * This method initializes jPanel1
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJPanel1() {
		if (jPanel1 == null) {
			GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
			gridBagConstraints7.gridx = 0;
			gridBagConstraints7.gridy = 0;
			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
			gridBagConstraints1.gridx = 0;
			gridBagConstraints1.gridy = 1;
			GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
			gridBagConstraints2.gridx = 1;
			gridBagConstraints2.gridy = 1;
			GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
			gridBagConstraints3.gridx = 2;
			gridBagConstraints3.gridy = 1;
			GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
			gridBagConstraints4.gridx = 0;
			gridBagConstraints4.gridy = 2;
			GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
			gridBagConstraints5.gridx = 1;
			gridBagConstraints5.gridy = 2;
			GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
			gridBagConstraints6.gridx = 2;
			gridBagConstraints6.gridy = 2;
			jPanel1 = new JPanel();
			jPanel1.setLayout(new GridBagLayout());
			jPanel1.add(getJButton1(), gridBagConstraints1);
			jPanel1.add(getJButton2(), gridBagConstraints2);
			jPanel1.add(getJButton3(), gridBagConstraints3);
			jPanel1.add(getJButton4(), gridBagConstraints4);
			jPanel1.add(getJButton5(), gridBagConstraints5);
			jPanel1.add(getJButton6(), gridBagConstraints6);
			jPanel1.add(getJButton7(), gridBagConstraints7);
		
		}
		return jPanel1;
	}

	

	/**
	 * This method initializes jButton1
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJButton1() {
		if (jButton1 == null) {
			jButton1 = new JButton();
			jButton1.setIcon(new ImageIcon(getClass().getResource(
					"/eraikikon/g1.png")));
			jButton1.setVisible(false);
			jButton1.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					System.out.println("actionPerformed()"); 
					for (TxartelIrakurgailua elem : nora)
						if ((elem.getHelburuGunea() == 1)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
							System.out.print("segui:" + elem.getAtea());
						}
					kudeatzailea.bidaliHelburuGunea(1);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				}
			});
		}
		return jButton1;
	}

	/**
	 * This method initializes jButton2
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJButton2() {
		if (jButton2 == null) {
			jButton2 = new JButton();
			jButton2.setIcon(new ImageIcon(getClass().getResource(
					"/eraikikon/g2.png")));
			jButton2.setVisible(false);
			jButton2.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 2)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(2);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				}
			});
		}
		return jButton2;
	}

	/**
	 * This method initializes jButton
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJButton() {
		if (jButton == null) {
			jButton = new JButton();
			jButton.setBounds(new Rectangle(570, 45, 151, 31));
			jButton.setText("Kokapena bistaratu");
			jButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					gui.botoiakEguneratu();
				}
			});
		}
		return jButton;
	}

	/**
	 * This method initializes jButton3
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJButton3() {
		if (jButton3 == null) {
			jButton3 = new JButton();
			jButton3.setIcon(new ImageIcon(getClass().getResource(
					"/eraikikon/g3.png")));
			jButton3.setVisible(false);
			jButton3.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 3)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(3);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				}
			});
		}
		return jButton3;
	}

	/**
	 * This method initializes jButton4
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJButton4() {
		if (jButton4 == null) {
			jButton4 = new JButton();
			jButton4.setIcon(new ImageIcon(getClass().getResource(
					"/eraikikon/g4.png")));
			jButton4.setVisible(false);
			jButton4.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 4)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(4);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				}
			});
		}
		return jButton4;
	}

	/**
	 * This method initializes jButton5
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJButton5() {
		if (jButton5 == null) {
			jButton5 = new JButton();
			jButton5.setIcon(new ImageIcon(getClass().getResource(
					"/eraikikon/g5.png")));
			jButton5.setVisible(false);
			jButton5.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 5)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(5);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				}
			});
		}
		return jButton5;
	}

	/**
	 * This method initializes jButton6
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getJButton6() {
		if (jButton6 == null) {
			jButton6 = new JButton();
			jButton6.setIcon(new ImageIcon(getClass().getResource(
					"/eraikikon/g6.png")));
			jButton6.setVisible(false);
			jButton6.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 6)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(6);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				}
			});
		}

		return jButton6;
	}

	/**
	 * This method initializes jTextField
	 * 
	 * @return javax.swing.JTextField
	 */
	private JTextField getJTextField() {
		if (jTextField == null) {
			jTextField = new JTextField();
			jTextField.setBounds(new Rectangle(300, 30, 151, 31));
			jTextField.setInputVerifier(new KonprobatuOsokoa());
		}
		return jTextField;
	}

	/**
	 * This method initializes jPasswordField
	 * 
	 * @return javax.swing.JPasswordField
	 */
	private JPasswordField getJPasswordField() {
		if (jPasswordField == null) {
			jPasswordField = new JPasswordField();
			jPasswordField.setBounds(new Rectangle(300, 75, 151, 31));
		}
		return jPasswordField;
	}

	public void botoiakEguneratu() {
		jButton1.setVisible(false);
		jButton2.setVisible(false);
		jButton3.setVisible(false);
		jButton4.setVisible(false);
		jButton5.setVisible(false);
		jButton6.setVisible(false);
		jButton7.setVisible(false);
		jButton8.setVisible(false);
		jButton9.setVisible(false);
		jButton10.setVisible(false);
		jButton11.setVisible(false);
		jButton12.setVisible(false);
		jButton13.setVisible(false);
		jButton1.setBackground(Color.lightGray);
		jButton2.setBackground(Color.lightGray);
		jButton3.setBackground(Color.lightGray);
		jButton4.setBackground(Color.lightGray);
		jButton5.setBackground(Color.lightGray);
		jButton6.setBackground(Color.lightGray);
		jButton7.setBackground(Color.lightGray);
		jButton8.setBackground(Color.lightGray);
		jButton9.setBackground(Color.lightGray);
		jButton10.setBackground(Color.lightGray);
		jButton11.setBackground(Color.lightGray);
		jButton12.setBackground(Color.lightGray);
		jButton13.setBackground(Color.lightGray);
		
		Itis kokagunea = kudeatzailea.getUnekoKokagunea(Integer
				.parseInt(jTextField.getText()));
		nora = kudeatzailea.noraJoan(kokagunea.getGunea());

		unekoGunea = kokagunea.getGunea();
		if (unekoGunea == 1) {
			jButton1.setBackground(Color.orange);
			jButton1.setVisible(true);
		}
		if (unekoGunea == 2) {
			jButton2.setBackground(Color.orange);
			jButton2.setVisible(true);
		}
		if (unekoGunea == 3) {
			jButton3.setBackground(Color.orange);
			jButton3.setVisible(true);
		}
		if (unekoGunea == 4) {
			jButton4.setBackground(Color.orange);
			jButton4.setVisible(true);
		}
		if (unekoGunea == 5) {
			jButton5.setBackground(Color.orange);
			jButton5.setVisible(true);
		}
		if (unekoGunea == 6) {
			jButton6.setBackground(Color.orange);
			jButton6.setVisible(true);
		}
		if (unekoGunea == 7) {
			jButton7.setBackground(Color.orange);
			jButton7.setVisible(true);
		}
		if (unekoGunea == 8) {
			jButton8.setBackground(Color.orange);
			jButton8.setVisible(true);
		}
		if (unekoGunea == 9) {
			jButton9.setBackground(Color.orange);
			jButton9.setVisible(true);
		}
		if (unekoGunea == 10) {
			jButton10.setBackground(Color.orange);
			jButton10.setVisible(true);
		}
		if (unekoGunea == 11) {
			jButton11.setBackground(Color.orange);
			jButton11.setVisible(true);
		}
		if (unekoGunea == 12) {
			jButton12.setBackground(Color.orange);
			jButton12.setVisible(true);
		}
		if (unekoGunea == 13) {
			jButton13.setBackground(Color.orange);
			jButton13.setVisible(true);
		}
		int i = 0;
		while (i < nora.size()) {
			Integer gune = nora.elementAt(i).getHelburuGunea();
			if (gune == 1)
				jButton1.setVisible(true);
			if (gune == 2)
				jButton2.setVisible(true);
			if (gune == 3)
				jButton3.setVisible(true);
			if (gune == 4)
				jButton4.setVisible(true);
			if (gune == 5)
				jButton5.setVisible(true);
			if (gune == 6)
				jButton6.setVisible(true);
			if (gune == 7)
				jButton7.setVisible(true);
			if (gune == 8)
				jButton8.setVisible(true);
			if (gune == 9)
				jButton9.setVisible(true);
			if (gune == 10)
				jButton10.setVisible(true);
			if (gune == 11)
				jButton11.setVisible(true);
			if (gune == 12)
				jButton12.setVisible(true);
			if (gune == 13)
				jButton13.setVisible(true);
			i = i + 1;
		}
	}
	/**
	 * This method initializes jPanel2	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanel2() {
		if (jPanel2 == null) {
			GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
			gridBagConstraints8.gridx = 0;
			gridBagConstraints8.gridy = 0;
			GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
			gridBagConstraints9.gridx = 1;
			gridBagConstraints9.gridy = 0;
			GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
			gridBagConstraints10.gridx = 2;
			gridBagConstraints10.gridy = 0;
			GridBagConstraints gridBagConstraints11= new GridBagConstraints();
			gridBagConstraints11.gridx = 0;
			gridBagConstraints11.gridy = 1;
			GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
			gridBagConstraints12.gridx = 1;
			gridBagConstraints12.gridy = 1;
			GridBagConstraints gridBagConstraints13 = new GridBagConstraints();
			gridBagConstraints13.gridx = 2;
			gridBagConstraints13.gridy = 1;
			jPanel2 = new JPanel();
			jPanel2.setLayout(new GridBagLayout());
			jPanel2.add(getJButton8(), gridBagConstraints8);
			jPanel2.add(getJButton9(), gridBagConstraints9);
			jPanel2.add(getJButton10(),gridBagConstraints10);
			jPanel2.add(getJButton11(), gridBagConstraints11);
			jPanel2.add(getJButton12(), gridBagConstraints12);
			jPanel2.add(getJButton13(), gridBagConstraints13);
		}
		return jPanel2;
	}

	/**
	 * This method initializes jButton7	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton7() {
		if (jButton7 == null) {
			jButton7 = new JButton();
			jButton7.setVisible(false);
			jButton7.setIcon(new ImageIcon(getClass().getResource("/eraikikon/kalea.PNG")));
			jButton7.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					// TODO Auto-generated Event stub actionPerformed()

					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 7)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(7);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				}
			});
			
		}
		return jButton7;
	}

	/**
	 * This method initializes jButton8	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton8() {
		if (jButton8 == null) {
			jButton8 = new JButton();
			jButton8.setIcon(new ImageIcon(getClass().getResource("/eraikikon/g8.PNG")));
			jButton8.setVisible(false);
			jButton8.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {

					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 8)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(8);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				
				}
			});
		}
		return jButton8;
	}

	/**
	 * This method initializes jButton9	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton9() {
		if (jButton9 == null) {
			jButton9 = new JButton();
			jButton9.setIcon(new ImageIcon(getClass().getResource("/eraikikon/g9.PNG")));
			jButton9.setVisible(false);
			jButton9.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {

					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 9)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(9);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				
				}
			});
		}
		return jButton9;
	}

	/**
	 * This method initializes jButton10	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton10() {
		if (jButton10 == null) {
			jButton10 = new JButton();
			jButton10.setIcon(new ImageIcon(getClass().getResource("/eraikikon/g10.PNG")));
			jButton10.setVisible(false);
			jButton10.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {

					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 10)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(10);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				
				}
			});
		}
		return jButton10;
	}

	/**
	 * This method initializes jButton11	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton11() {
		if (jButton11 == null) {
			jButton11 = new JButton();
			jButton11.setIcon(new ImageIcon(getClass().getResource("/eraikikon/g11.PNG")));
			jButton11.setVisible(false);
			jButton11.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {

					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 11)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(11);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				
				}
			});
		}
		return jButton11;
	}

	/**
	 * This method initializes jButton12	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton12() {
		if (jButton12 == null) {
			jButton12 = new JButton();
			jButton12.setIcon(new ImageIcon(getClass().getResource("/eraikikon/g12.PNG")));
			jButton12.setVisible(false);
			jButton12.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {

					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 12)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(12);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				
				}
			});
		}
		return jButton12;
	}

	/**
	 * This method initializes jButton13	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton13() {
		if (jButton13 == null) {
			jButton13 = new JButton();
			jButton13.setIcon(new ImageIcon(getClass().getResource("/eraikikon/g13.PNG")));
			jButton13.setVisible(false);
			jButton13.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {

					for (TxartelIrakurgailua elem : nora) {
						if ((elem.getHelburuGunea() == 13)
								&& (unekoGunea == elem.getGunea()))
						{
							kudeatzailea.bidaliTxartelIrakurgailuId(elem
									.getId());
							kudeatzailea.bidaliAtea(elem.getAtea());
						}
					}
					kudeatzailea.bidaliHelburuGunea(13);
					kudeatzailea.sarbideaEskatu(Integer.parseInt(jTextField
							.getText()), jPasswordField.getText());
					gui.botoiakEguneratu();
				
				}
			});
		}
		return jButton13;
	}

	public static void main(String [] args){
		GUI gui=new GUI();
		gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		gui.setVisible(true);
	}
} // @jve:decl-index=0:visual-constraint="10,10"
